﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="maintenancePosts.aspx.vb" Inherits="Web_2._0_BMW___X6_Experts_Web_Application.maintenancePosts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style2
        {
            font-size: x-large;
            text-decoration: underline;
        }
        .style3
        {
            font-size: x-large;
            text-decoration: underline;
            color: #3399FF;
        }
        .content
        {
            height: 888px;
            margin-bottom: 263px;
        }
        .st
        {
            font-size: medium;
        }
        .style4
        {
            font-weight: normal;
            font-size: large;
        }
        .style5
        {
            font-style: normal;
            color: #3366FF;
        }
        .style6
        {
            font-size: small;
        }
        .maintenancePosts
        {
            margin-bottom: 115px;
            height: 408px;
        }
        .main1000
        {
            height: 73px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p class="style2">
        <strong>BMW - X6 </strong> <span class="style3"><em><strong>Maintenance</strong></em></span><strong> Discussion Forum 
        Posts...</strong></p>

        <div class = "content">
        <div class = "contentDiscussionTitle">
        
        <span class="st">
            <br />
    
    
    
        <asp:FormView ID="FormView1" runat="server" DataKeyNames="MaintenanceDisID" 
            DataSourceID="SqlDataSource1" Width="869px" Font-Bold="True" 
            Font-Italic="True" Font-Size="Medium" ForeColor="#FF6600" Height="81px" 
                style="font-size: medium">
            <EditItemTemplate>

                Title:
                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />
                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                    CommandName="Update" Text="Update" />
                &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </EditItemTemplate>
            <InsertItemTemplate>
                Title:
                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                <br />
                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                    CommandName="Insert" Text="Insert" />
                &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </InsertItemTemplate>
            <ItemTemplate>

                <span class="style4"><strong><span class="style5">
                <br />
                Title:</span>
                <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' 
                    style="color: #3366FF" />
                </strong></span>
                <br />

            </ItemTemplate>
        </asp:FormView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT [MaintenanceDisID], [Title] FROM [Maintenance_Discussion] WHERE ([MaintenanceDisID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="MaintenanceDisID" QueryStringField="id" 
                        Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <br />
        </span>
        
        <span class="style6">
    
    
        Below are the posts replied to the 
            <em><strong>maintenance</strong></em> discussion title shown above. To add a reply, 
        you must be a registered user and logged in.
    
    
        Click here to <a href = "Account/Register.aspx">Register</a> or <a href = "Account/Login.aspx">Login</a></span><span class="st"><br />

        <div class = "main1000">
        
            <span class="st">
            <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource2" 
                    style="font-size: small; font-family: Calibri">
                    <AlternatingItemTemplate>
                        
                        <br />
                        <strong>Post Message Replied:</strong>
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        <strong>Date Posted:</strong>
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        <strong>Time Posted:</strong>
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        <strong>Posted by:</strong>
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                       
                        
                        <br /></span>
                    </AlternatingItemTemplate>
                    <EditItemTemplate>
                        PostID:
                        <asp:Label ID="PostIDLabel1" runat="server" Text='<%# Eval("PostID") %>' />
                        <br />
                        PostBody:
                        <asp:TextBox ID="PostBodyTextBox" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:TextBox ID="DatePostedTextBox" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:TextBox ID="TimePostedTextBox" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />
                        UserName:
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        MaintenanceDisIDFK:
                        <asp:TextBox ID="MaintenanceDisIDFKTextBox" runat="server" 
                            Text='<%# Bind("MaintenanceDisIDFK") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                        <br /><br /></span>
                    </EditItemTemplate>
                    <EmptyDataTemplate>
                        <span>No data was returned.</span>
                    </EmptyDataTemplate>
                    <InsertItemTemplate>
                        <span style="">PostBody:
                        <asp:TextBox ID="PostBodyTextBox0" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />DatePosted:
                        <asp:TextBox ID="DatePostedTextBox0" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />TimePosted:
                        <asp:TextBox ID="TimePostedTextBox0" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />UserName:
                        <asp:TextBox ID="UserNameTextBox0" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />MaintenanceDisIDFK:
                        <asp:TextBox ID="MaintenanceDisIDFKTextBox0" runat="server" 
                            Text='<%# Bind("MaintenanceDisIDFK") %>' />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton0" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                        <br /><br /></span>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        
                        <br />
                        <strong>Post Message Replied:</strong>
                        <asp:Label ID="PostBodyLabel0" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        <strong>Date Posted:</strong>
                        <asp:Label ID="DatePostedLabel0" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        <strong>Time Posted:</strong>
                        <asp:Label ID="TimePostedLabel0" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        <strong>Posted by:</strong>
                        <asp:Label ID="UserNameLabel0" runat="server" Text='<%# Eval("UserName") %>' />
                        
                        
<br /></span>
                    </ItemTemplate>
                    <LayoutTemplate>
                        <div ID="itemPlaceholderContainer" runat="server" 
                            style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                            <span runat="server" id="itemPlaceholder" />
                        </div>
                        <div>
                            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="10">
                            
                                <Fields>
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                        ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </div>
                    </LayoutTemplate>
                    <SelectedItemTemplate>
                        
                        PostID:
                        <asp:Label ID="PostIDLabel" runat="server" Text='<%# Eval("PostID") %>' />
                        <br />
                        PostBody:
                        <asp:Label ID="PostBodyLabel1" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:Label ID="DatePostedLabel1" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:Label ID="TimePostedLabel1" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        UserName:
                        <asp:Label ID="UserNameLabel1" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                        MaintenanceDisIDFK:
                        <asp:Label ID="MaintenanceDisIDFKLabel" runat="server" 
                            Text='<%# Eval("MaintenanceDisIDFK") %>' />
                        <br />
<br /></span>
                    </SelectedItemTemplate>
                </asp:ListView>
        </span>
        
        </div>

            <div class = "maintenancePosts">
                <span class="st">
                
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                    
                    SelectCommand="SELECT Maintenance_Posts.PostID, Maintenance_Posts.PostBody, Maintenance_Posts.DatePosted, Maintenance_Posts.TimePosted, aspnet_Users.UserName, Maintenance_Posts.MaintenanceDisIDFK FROM (aspnet_Users INNER JOIN Maintenance_Posts ON aspnet_Users.UserId = Maintenance_Posts.UserIDFK) WHERE (Maintenance_Posts.MaintenanceDisIDFK = ?) ORDER BY Maintenance_Posts.PostID DESC">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="?" QueryStringField="id" />
                    </SelectParameters>
                </asp:SqlDataSource>
            
        </span>
        
            </div>
        </span>
        
        </div>
        </div>
</asp:Content>
